#include "Mainwindow.h"
#include "TeacherMainwindow.h"
#include <QApplication>
#include <QTextCodec>  //添加头文
#include "logindialog.h"
int main(int argc, char *argv[])
{
	QApplication a(argc, argv);
	QTextCodec::setCodecForLocale(QTextCodec::codecForLocale());  
	Mainwindow stuW;

	TeacherMainwindow teacherW;
	LoginDialog login;
	
	if (login.exec() == QDialog::Accepted)
	{
		QString roletype = login.getRoleType();
		QString userId = login.getUserId();
		if (roletype == "学生") {
			
			stuW.getUi().loginUserLabel->setText(userId);
			stuW.show();
		}
		else {
			teacherW.getUi().loginUserLabel->setText(userId);
			teacherW.show();
		}
		return a.exec();
	}
	return 0;
}
